package com.lhy.controller;


import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;


import com.lhy.domain.Tea;
import com.lhy.service.IUserService;

@Controller
@RequestMapping("/menu")
public class MenuController {
	@Autowired
	private IUserService userService;
	
	@RequestMapping("/do")
	public ModelAndView list(HttpSession session,String teaname){
		
		ModelAndView mv = new ModelAndView();
		try {
			System.out.println(teaname);
			String teaName= java.net.URLDecoder.decode(teaname, "utf-8");
			System.out.println(teaName);
			Tea tea = userService.queryTeaByteaname(teaName);
			mv.addObject("tea",tea);
			mv.setViewName("teadetail");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return mv;
	}
}
